package com.york.tinyrpc.protoss.fault.tolerant;

import com.york.tinyrpc.protoss.model.TinyRpcResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * 快速失败
 */
public class FailFastTolerantStrategy implements TolerantStrategy {

    private static final Logger log = LoggerFactory.getLogger(FailFastTolerantStrategy.class);


    @Override
    public TinyRpcResponse doTolerant(Map<String, Object> context, Exception e) {
        log.error("【Fail-Fast】");
        throw new RuntimeException("【Fail-Fast】 - 服务报错", e);
    }
}
